package cn.edu.scut.fsearch.util;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;


public class Encoder {
	public static String [] code(String [] strings ,String charset) throws UnsupportedEncodingException
	{
		int length = strings.length;
		String [] result = new String[length];
		for(int i=0;i<length;i++)
		{
			result[i] = new String(strings[i].getBytes(charset));
			//result[i] = URLDecoder.decode(strings[i], charset);
		}
		return result;
	}
	
	public static String code(String string ,String charset) throws UnsupportedEncodingException
	{
		return new String(string.getBytes(charset));
	}
}
